<%--
  Created by IntelliJ IDEA.
  User: ZT171
  Date: 2024/9/27
  Time: 15:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="./static/layui/css/layui.css">
    <style>
        table {
            width: 800px !important;
            margin: 0 auto !important;

        }
        .center-form {
            margin-left: auto;
            margin-right: auto;
            text-align: center; /* 使内部文本和按钮居中 */
            width: 50%; /* 或者根据需要调整宽度 */
        }
    </style>
</head>
<body>


<%-- ${} el表达式 --%>
<p>
    <form action="user?action=list" method="post">
    <div class="layui-form-item center-form">
        <div class="layui-inline">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="tel" name="name" autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="tel" name="name" autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
            </div>

            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
            <button  class="layui-btn" lay-submit lay-filter="demo1><a href="add.jsp">添加用户</a><br></button>
        </div>
    </div>

</p>
</form>
<table class="layui-table" lay-even>

    <colgroup>
        <col width="150">
        <col width="150">
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>密码</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
<c:forEach items="${users}" var="user">
    <tr>
        <td>${user.id}</td>
        <td>${user.name}</td>
        <td>${user.pass}</td>
        <td>
            <a href="user?action=toupdate?id=${user.id}">修改</a>
            <a href="user?action=delete?id=${user.id}">删除</a>
        </td>
    </tr>
</c:forEach>
    </tbody>
</table>
</body>
</html>
